/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tramite.be;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.cip.esymons.colegiatura.be.Colegiado;
import org.cip.esymons.general.be.PersonaNatural;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "tra_recepcionador_autorizado_certificado")
@NamedQueries({@NamedQuery(name = "RecepAutoCert.findAll", query = "SELECT r FROM RecepAutoCert r"), @NamedQuery(name = "RecepAutoCert.findByRceCodigo", query = "SELECT r FROM RecepAutoCert r WHERE r.rceCodigo = :rceCodigo"), @NamedQuery(name = "RecepAutoCert.findByRceVigente", query = "SELECT r FROM RecepAutoCert r WHERE r.rceVigente = :rceVigente"), @NamedQuery(name = "RecepAutoCert.findByRceFechregistro", query = "SELECT r FROM RecepAutoCert r WHERE r.rceFechregistro = :rceFechregistro")})
public class RecepAutoCert implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "rce_codigo")
    private Long rceCodigo;
    @Basic(optional = false)
    @Column(name = "rce_vigente")
    private boolean rceVigente;
    @Basic(optional = false)
    @Column(name = "rce_fechregistro")
    @Temporal(TemporalType.DATE)
    private Date rceFechregistro;
    @JoinColumn(name = "fk_sol_codigocol", referencedColumnName = "col_codigo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Colegiado fkSolCodigocol;
    @JoinColumn(name = "fk_sol_codigopna", referencedColumnName = "per_codigo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private PersonaNatural fkSolCodigopna;

    public RecepAutoCert() {
    }

    public RecepAutoCert(Long rceCodigo) {
        this.rceCodigo = rceCodigo;
    }

    public RecepAutoCert(Long rceCodigo, boolean rceVigente, Date rceFechregistro) {
        this.rceCodigo = rceCodigo;
        this.rceVigente = rceVigente;
        this.rceFechregistro = rceFechregistro;
    }

    public Long getRceCodigo() {
        return rceCodigo;
    }

    public void setRceCodigo(Long rceCodigo) {
        this.rceCodigo = rceCodigo;
    }

    public boolean getRceVigente() {
        return rceVigente;
    }

    public void setRceVigente(boolean rceVigente) {
        this.rceVigente = rceVigente;
    }

    public Date getRceFechregistro() {
        return rceFechregistro;
    }

    public void setRceFechregistro(Date rceFechregistro) {
        this.rceFechregistro = rceFechregistro;
    }

    public Colegiado getFkSolCodigocol() {
        return fkSolCodigocol;
    }

    public void setFkSolCodigocol(Colegiado fkSolCodigocol) {
        this.fkSolCodigocol = fkSolCodigocol;
    }

    public PersonaNatural getFkSolCodigopna() {
        return fkSolCodigopna;
    }

    public void setFkSolCodigopna(PersonaNatural fkSolCodigopna) {
        this.fkSolCodigopna = fkSolCodigopna;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (rceCodigo != null ? rceCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RecepAutoCert)) {
            return false;
        }
        RecepAutoCert other = (RecepAutoCert) object;
        if ((this.rceCodigo == null && other.rceCodigo != null) || (this.rceCodigo != null && !this.rceCodigo.equals(other.rceCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.tramite.be.RecepAutoCert[rceCodigo=" + rceCodigo + "]";
    }

}
